package com.hckjsec.oa.service.impl;

import java.util.List;
import com.hckjsec.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hckjsec.oa.mapper.OaMissionMapper;
import com.hckjsec.oa.domain.OaMission;
import com.hckjsec.oa.service.IOaMissionService;

/**
 * 公司OA出差Service业务层处理
 * 
 * @author cyt
 * @date 2022-01-06
 */
@Service
public class OaMissionServiceImpl implements IOaMissionService 
{
    @Autowired
    private OaMissionMapper oaMissionMapper;

    /**
     * 查询公司OA出差
     * 
     * @param id 公司OA出差ID
     * @return 公司OA出差
     */
    @Override
    public OaMission selectOaMissionById(Long id)
    {
        return oaMissionMapper.selectOaMissionById(id);
    }

    /**
     * 查询公司OA出差列表
     * 
     * @param oaMission 公司OA出差
     * @return 公司OA出差
     */
    @Override
    public List<OaMission> selectOaMissionList(OaMission oaMission)
    {
        return oaMissionMapper.selectOaMissionList(oaMission);
    }

    /**
     * 新增公司OA出差
     * 
     * @param oaMission 公司OA出差
     * @return 结果
     */
    @Override
    public int insertOaMission(OaMission oaMission)
    {
        oaMission.setCreateTime(DateUtils.getNowDate());
        return oaMissionMapper.insertOaMission(oaMission);
    }

    /**
     * 修改公司OA出差
     * 
     * @param oaMission 公司OA出差
     * @return 结果
     */
    @Override
    public int updateOaMission(OaMission oaMission)
    {
        oaMission.setUpdateTime(DateUtils.getNowDate());
        return oaMissionMapper.updateOaMission(oaMission);
    }

    /**
     * 批量删除公司OA出差
     * 
     * @param ids 需要删除的公司OA出差ID
     * @return 结果
     */
    @Override
    public int deleteOaMissionByIds(Long[] ids)
    {
        return oaMissionMapper.deleteOaMissionByIds(ids);
    }

    /**
     * 删除公司OA出差信息
     * 
     * @param id 公司OA出差ID
     * @return 结果
     */
    @Override
    public int deleteOaMissionById(Long id)
    {
        return oaMissionMapper.deleteOaMissionById(id);
    }
}
